﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Simple.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <link rel="stylesheet" href="/Content/colorbox/colorbox.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" src="/Scripts/swfobject.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.uploadify.min.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.colorbox-min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#custom_file_upload').uploadify({
                'swf': '/Content/Style/uploadify.swf',
                'uploader': '/Public/TempUpload',
                'auto': true,
                'fileExt': '*.jpg;*.gif;*.png',
                'fileDesc': 'Image Files (.JPG, .GIF, .PNG)',
                'queueSizeLimit': 1,
                'buttonText': '<a href="#">上传战队形象</a>',
                'itemTemplate': '<div></div>',
                'onUploadComplete': function (file) {
                    $("#imgPhoto").attr("src", "/TempImage/" + file.name);
                    $("#ImgName").val(file.name);
                    $("#progress").fadeOut();
                },
                'onUploadProgress': function (file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) {
                    $('#progress').html(totalBytesUploaded + '/' + totalBytesTotal);
                }
            });
        });
    </script>
    <div id="content">
        <% using (Html.BeginForm("Create", "Group"))
           { %>
        <div class="creat_group">
            <h1 class="yahei">
                成立新战队<span> 战队可以入驻多个运动吧</span></h1>
            <div class="creat_group_form clear">
                <div class="avatar">
                    <div class="default_avatar">
                        <div>
                            <a href="#">
                                <img id="imgPhoto" src="/Content/image/group_avatar.png" width="160" height="160"
                                    alt="" /></a>
                        </div>
                        <div class="upload_link">
                            <i class="icon"></i>
                            <input id="custom_file_upload" type="file" name="Filedata" />
                            <%= Html.Hidden("ImgName") %>
                        </div>
                        <div id="progress">
                        </div>
                    </div>
                    <div class="creat_link">
                    </div>
                </div>
                <div class="detail">
                    <div class="item_label">
                        入驻运动吧</div>
                    <div class="item_input clear yahei">
                        <%
                            SiteChannelDto channelDto = ViewData["ChannelDto"] as SiteChannelDto ?? new SiteChannelDto();%>
                        <a href="#" class="ba_name">
                            <%=channelDto.ChannelName%></a><a href="#DivAllChannel" id="linkChannel" class="ba_name">+</a>
                    </div>
                    <div class="item_label">
                        战队名称</div>
                    <div class="item_input">
                        <input name="Name" type="text" class="txt" /></div>
                    <div class="item_label">
                        战队标识</div>
                    <div class="item_input">
                        <input name="Code" type="text" class="txt" /></div>
                    <div class="item_label">
                        选择模板</div>
                    <div class="item_input">
                        <select name="TemplateId">
                            <option value="1">默认模板</option>
                        </select></div>
                    <div class="item_label">
                        战队简介</div>
                    <div class="item_input">
                        <textarea name="Summary" cols="" rows="" class="txt_area"></textarea></div>
                    <div class="item_label">
                        验证码</div>
                    <div class="item_input item_input_yzm clear">
                        <input name="Validate" type="text" class="txt" />
                        <% var imgUrl = Url.Action("LoginValidateImage", "Public");%>
                        <img src="<%:imgUrl%>" style="cursor: pointer;" alt="换一张" onclick="this.src=this.src+'?'" /></div>
                    <div class="item_input">
                        <input name="" type="submit" value="创建" class="btn yahei" /></div>
                    </>
                </div>
            </div>
        </div>
        <div style="display: none">
            <div id="DivAllChannel" style="width: 100; height: 100; background-color: White">
                <%
                    List<SiteChannelDto> channelDtos = ViewData["SiteChannels"] as List<SiteChannelDto> ??
                                                       new List<SiteChannelDto>();%>
                <%
                    foreach (SiteChannelDto channel in channelDtos)
                    {%>
                <input type="checkbox" name="SelectChannel" value="<%=channel.ChannelId%>" <%=channel.ChannelCode == ViewData["Id"].ToString() ? "checked=\"checked\"" : ""%> />
                <%=channel.ChannelName%><br />
                <%
                    }%>
            </div>
        </div>
        <%
            }%>
        <script type="text/javascript">
            $("#linkChannel").colorbox({
                inline: true,
                width: "50%",
                onLoad: function () { $("#cboxClose").remove(); }
            });

            
        </script>
</asp:Content>
